﻿
//----------------------------------------------------------------------
// <copyright file="Log.cs" company="O-RID">
// Copyright (c)2010 O-RID Co.,Ltd.
// </copyright>
// <author>lidawei</author>
// <summary> 
// 作成日： 2011/10/21
// </summary>
//----------------------------------------------------------------------

namespace Orid.Management.SOHO.Book.Service
{
    using System;

    /// <summary>
    /// Log
    /// 日志类 继续自LogBase
    /// </summary>
    public class Log : LogBase
    {
        /// <summary>
        /// Initializes a new instance of the Log class.
        /// 构造方法
        /// 从WEB.COMFIG中读取节点LOG信息
        /// </summary>
        public Log()
        {
            Entrylog = log4net.LogManager.GetLogger("Log");
        }
    }

        /// <summary>
        /// LogBase
        /// </summary>
        public class LogBase
        {

            /// <summary>
            /// Entry log
            /// </summary>
            protected log4net.ILog Entrylog;

            /// <summary>
            /// Errors the specified message.
            /// </summary>
            /// <param name="message">The message.</param>
            public void Error(string message)
            {

                Entrylog.Error(message);

            }

            /// <summary>
            /// Warnings the specified message.
            /// </summary>
            /// <param name="message">The message.</param>
            /// <param name="exception">The exception.</param>
            public void Warning(string message, Exception exception)
            {
                Entrylog.Warn(message, exception);
            }

            /// <summary>
            /// Fatals the specified message.
            /// </summary>
            /// <param name="message">The message.</param>
            /// <param name="exception">The exception.</param>
            public void Fatal(string message, Exception exception)
            {
                Entrylog.Fatal(message, exception);
            }

            /// <summary>
            /// Fatals the specified message.
            /// </summary>
            /// <param name="message">The message.</param>
            public void Fatal(string message)
            {
                Entrylog.Fatal(message);
            }

            /// <summary>
            /// Infoes the specified message.
            /// </summary>
            /// <param name="message">The message.</param>
            /// <param name="exception">The exception.</param>
           public void Info(string message, Exception exception)
            {

                Entrylog.Info(message, exception);

            }

            /// <summary>
            /// Infoes the specified message.
            /// </summary>
            /// <param name="message">The message.</param>
            public void Info(string message)
            {

                Entrylog.Info(message);

            }

            /// 
            /// 记录调试信息
            /// 
            /// 信息内容
            /// 异常对象
            public void Debug(string message, Exception exception)
            {

                Entrylog.Debug(message, exception);

            }

            /// 
            ///  记录调试信息
            /// 
            /// 信息内容
            public void Debug(string message)
            {

                Entrylog.Debug(message);

            }
        }
    }

 
 